﻿using AutoMapper;
using Modules;
using PmSoft;

namespace AppWebApi.Models.Dtos
{
    public class ManagerInfoDto
    {
        /// <summary>
		/// 管理员ID 
		///</summary>
        public int ManagerId { get; set; }
        /// <summary>
        /// 管理员姓名 
        ///</summary>
        public string Name { get; set; }
        /// <summary>
        /// 手机号码 
        ///</summary>
        public string Mobile { get; set; }
        /// <summary>
        /// 身份证号码 
        ///</summary>
        public string Cardno { get; set; }
        /// <summary>
        /// 安全信息ID 
        ///</summary>
        public int SecurityId { get; set; }
        /// <summary>
        /// 默认项目ID
        /// </summary>
        public int ProjectId { get; set; }
        /// <summary>
        /// 创建时间 
        /// 默认值: CURRENT_TIMESTAMP
        ///</summary>
        public DateTime CreateTime { get; set; } = DateTime.Now;
        /// <summary>
        /// 身份证照片
        /// </summary>
        public string? Base64PhotoStr { get; set; }
        public bool IsAuth { get; set; } = false;
        public string? Token { get; set; }

        #region 扩展字段
        /// <summary>
        /// 人脸动作
        /// </summary>
        public int[] Actions { get; set; }
        /// <summary>
        /// 识别唯一标识
        /// </summary>
        public string ScanCode { get; set; }
        #endregion
    }

    public static partial class ManagerInfoExceptions
    {
        public static ManagerInfoDto AsDto(this ManagerInfo managerInfo)
        {

            return ServiceAccessor.GetService<IMapper>().Map(managerInfo, new ManagerInfoDto());
        }


    }
}
